from django.conf import settings
from django.conf.urls.defaults import * #@UnusedWildImport
from django.contrib import admin
import views
admin.autodiscover()

urlpatterns = patterns('',    
    url(r'^task-(?P<task_id>\d+)/$', views.task_details, name="task_details"),

    url(r'^$', views.task_list, name="task_list"),
    
    url(r'^projects/$', views.project_list, name="project_list"),    
    url(r'^users/$', views.user_list, name="user_list"),
    
    url(r'^projects/(?P<project_id>\d+)/$', views.task_list, name="task_list"),    
    url(r'^projects/(?P<project_id>\d+)/user-(?P<user_id>\d+)/$', views.task_list, name="task_list"),    
    
    url(r'^users/(?P<user_id>\d+)/$', views.task_list, name="task_list"),
    url(r'^users/(?P<user_id>\d+)/project-(?P<project_id>\d+)/$', views.task_list, name="task_list"),
    
    (r'^admin/(.*)', admin.site.root),
)


if getattr(settings, 'SERVE_STATIC', False):
    urlpatterns = patterns('',
        (r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'), 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    ) + urlpatterns

